<template>
  <div class="themeContainer">
    <h3 class="title">四川旅游景点专题展示</h3>
    <div class="inner">
      <div class="column">
        <el-button v-model="activeReli" :type="activeReli" @click="showRelitu">景点热力图</el-button>
      </div>
      <div class="column">
        <el-button v-model="activeJuhe" :type="activeJuhe" @click="showJuhetu">景点聚合图</el-button>
      </div>
      <div class="column">
        <el-button v-model="activeFengchao" :type="activeFengchao" @click="showFengchaotu">景点蜂巢图</el-button>
      </div>
      <div class="column">
        <el-button v-model="activeFengchao" type="primary" @click="removeAll">移除图层</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import bus from '@/utils/bus.js'

export default {
  name: 'ThemeMap',
  data() {
    return {
      activeReli: 'primary',
      activeJuhe: 'primary',
      activeFengchao: 'primary'
    }
  },
  methods: {
    showRelitu() {
      this.activeReli = 'danger'
      this.activeJuhe = 'primary'
      this.activeFengchao = 'primary'
      bus.$emit('addRelitu')
    },
    showJuhetu() {
      this.activeReli = 'primary'
      this.activeJuhe = 'danger'
      this.activeFengchao = 'primary'
      bus.$emit('addJuhetu')
    },
    showFengchaotu() {
      this.activeReli = 'primary'
      this.activeJuhe = 'primary'
      this.activeFengchao = 'danger'
      bus.$emit('addFengchaotu')
    },
    removeAll() {
      this.activeReli = 'primary'
      this.activeJuhe = 'primary'
      this.activeFengchao = 'primary'
      bus.$emit('removeAllLayer')
    }
  }
}
</script>

<style lang="less" scoped>
.themeContainer {
  display: flex;
  width: 280px;
  height: 25px;
  border: 10px solid pink;
  border-width: 51px 38px 20px 132px;
  border-image-source: url(../../assets/images/border.png);
  border-image-slice: 51 38 20 132;
  .title {
    position: absolute;
    font-weight: bold;
    z-index: 999;
    top: -8px;
    left: 25px;
    height: 18px;
    line-height: 1;
    padding: 0 18px;
    color: red;
    font-size: 18px;
    border-right: 0.025rem solid #00f2f1;
    user-select: none;
  }
}

.inner {
  position: absolute;
  display: flex;
  top: 40px;
  left: 8px;
  width: 270px;
  height: 20px;
  .column {
    flex-grow: 1;
    margin-right: 8px;
  }
}
</style>
